package com.ityedao.IO序列化流;

import java.io.Serializable;

public class User implements Serializable {
    private String loginName;
    private String name;
    private transient String password; // 用transient修饰符所修饰的属性变量不会参与序列化
    private int age;

    @Override
    public String toString() {
        return "User{" +
                "loginName='" + loginName + '\'' +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                '}';
    }

    public User() {
    }

    public User(String loginName, String name, String password, int age) {
        this.loginName = loginName;
        this.name = name;
        this.password = password;
        this.age = age;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
